{% extends "topnav.html"%}

{% block title %}
业务录入
{% endblock %}

<body>
{% block body %}
<div class="container-fluid ">
    <div class="col-sm-2">
        <div class="menus">
            <div class="item">
                <div class="header" onclick="clickMe(this);">业务处理</div>
                <div class="content hide">
                    <a href="{{url_for('sm.insert')}}">--业务录入</a>
                    <a href="{{url_for('sm.process')}}">--业务审批</a>
                    <a href="{{url_for('sm.search')}}">--业务查询</a>
                    <a>--使用说明</a>
                </div>
            </div>
            <div class="item">
                <div class="header" onclick="clickMe(this);">信息与沟通</div>
                <div class="content hide">
                    <a>--查询分析</a>
                    <a>--公告通知</a>
                    <a>--系统说明</a>
                    <a>--数据导出</a>
                </div>
            </div>
        </div>
    </div>
    <div class="col-sm-10">
        <a href="{{url_for('sm.add_statement')}}">新增现金支付说明</a>
        <div class="panel panel-info">
            <div class="panel-heading">
                <span class="glyphicon glyphicon-th-list" aria-hidden="true"></span>
                我的业务列表
            </div>
            <div class="panel-body">
                <table class="table table-hover">
                    <thead>
                    <tr>
                        <th>单号</th>
                        <th>说明人</th>
                        <th>金额</th>
                        <th>原因</th>
                        <th>状态</th>
                        <th>录入人</th>
                        <th>录入时间</th>
                        <th>提交人</th>
                        <th>提交时间</th>
                        <th>审批人</th>
                        <th>审批时间</th>
                    </tr>
                    </thead>
                    <tbody>
                    {%for my_statement in my_statements%}
                    <tr>
                        <td>{{my_statement.id}}</td>
                        <td>{{my_statement.name}}</td>
                        <td>{{my_statement.amount}}</td>
                        <td>{{my_statement.reason}}</td>
                        <td>{{my_statement.status}}</td>
                        <td>{{my_statement.inputer}}</td>
                        <td>{{my_statement.input_time}}</td>
                        <td>{{my_statement.submitter}}</td>
                        <td>{{my_statement.submit_time}}</td>
                        <td>{{my_statement.approver}}</td>
                        <td>{{my_statement.approve_time}}</td>
                    </tr>
                    {% endfor %}
                    </tbody>
                </table>
                <nav aria-label="Page navigation">
                    <ul class="pagination">
                        <li>
                            <a href="#" aria-label="Previous">
                                <span aria-hidden="true">&laquo;</span>
                            </a>
                        </li>
                        <li><a href="#">1</a></li>
                        <li><a href="#">2</a></li>
                        <li><a href="#">3</a></li>
                        <li><a href="#">4</a></li>
                        <li><a href="#">5</a></li>
                        <li>
                            <a href="#" aria-label="Next">
                                <span aria-hidden="true">&raquo;</span>
                            </a>
                        </li>
                    </ul>
                </nav>
            </div>
        </div>
    </div>
</div>
    <script src="../static/js/jquery-3.7.0.min.js"></script>
    <script src="../static/plugins/bootstrap-3.4.1/js/bootstrap.min.js"></script>

    <script type="text/javascript">
        function clickMe(self) {
            var hasHide = $(self).next().hasClass("hide");
            if (hasHide) {
                $(self).next().removeClass("hide");
            } else {
                $(self).next().addClass("hide");
            }
        }
    </script>

    <script>
        var currentTime = new Date();
        var year = currentTime.getFullYear();
        var month = (currentTime.getMonth() + 1).toString().padStart(2, '0');
        var date = currentTime.getDate().toString().padStart(2, '0');
        var hour = currentTime.getHours().toString().padStart(2, '0');
        var minute = currentTime.getMinutes().toString().padStart(2, '0');

        var defaultValue = year + '-' + month + '-' + date + 'T' + hour + ':' + minute;
        document.getElementById("input_time").value = defaultValue;
    </script>

    {% endblock %}
</body>